'use strict'


module.exports = app => {
    const mongoose = app.mongoose
    const Schema = mongoose.Schema
    const ObjectId = Schema.Types.ObjectId
    const ChatSchema = new Schema({
        // 作者
        user_id:{
            type:ObjectId,
            ref:'User'
        },
       //
        send_user_id:{
            type:ObjectId,
            ref:'User'
        },
        chatList:{
            type:[],
            default:[]
        }

    },{ versionKey:false })

    return mongoose.model('Chat',ChatSchema,'Chat')
}
